import React from 'react'
import {isLogin} from '@u/index'
import { Navigate } from 'react-router-dom'
export default  (Decorator:React.FC) => {
  return (props: object) => (
    <>
      {
        isLogin()
        ?
        <Decorator {...props}/>
        :
        <Navigate to="/login" replace/>
      }
    </>
  )
}
